import { reqIndexData } from '../../api/index'

Page({
    data: {
        bannerList: [],
        categoryList: [],
        activeList: [],
        guessList: [],
        hotList: [],
        loading: true //是否生成骨架屏
    },

    async getIndexData() {
        const res = await reqIndexData()
         this.setData({
            bannerList: res[0].data,
            categoryList: res[1].data,
            activeList: res[2].data,
            guessList: res[3].data,
            hotList: res[4].data,
            loading: false
         })
    },

    onLoad() {
        this.getIndexData()
    },

    // 转发功能
    onShareAppMessage() {
        return {
            title: '所有的砰然心动，都是你',
            path: '/pages/index/index',
            imageUrl: '../../../../../assets/images/love.jpg'
        }
    },

    // 分享到朋友圈功能
    onShareTimeline() {},
})
